package com.innerclass.closepackage.demo1;

public class Callee2 extends MyIncrement {

	private int i = 0;

	public void increment() {
		super.increment();
		i++;
		System.out.println(i);
	}

	// 回调就是允许客户类通过内部类引用来调用其外部类的方法
	private class Closure implements Incrementable {
		public void increment() {
			Callee2.this.increment();
		}
	}

	Incrementable getCallbackReference() {
		return new Closure();
	}
}